<template>
  <div class="footer" :style="{color: props.color}">
    <div>Copyright © 2022-{{ currentYear }} {{ title }} 版权所有</div>
    <a class="ml-5" :style="{color: props.color}" href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">渝ICP备xxx号</a>
  </div>
</template>

<script setup name="Footer">
const currentYear = ref('');
const title = import.meta.env.VITE_COPYRIGHT_TITLE;
const props = defineProps({
  color: {
    type: String,
    required: false,
  }
})

function getCurrentYear() {
  const date = new Date();
  currentYear.value = date.getFullYear();
}

getCurrentYear()
</script>

<style scoped lang="scss">
.footer {
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  height: 50px;
  text-align: center;
  font-weight: 400;
  font-size: 14px;
  font-family: 'PingFangSC-Regular', sans-serif;
  padding-bottom: 2px;
}
</style>
